<?php
class UserMenu extends Portlet {
	protected function _renderContent() {
		if (Yii::app ()->user->isGuest) {
			$systemNavigation = array(
				'pages' => array(
					array(
						'label' => Yii::t('crm', 'Login'),
						'url' => array('/core/user/login'),
						'icon' => 'lock'
					),
				),
			);
		} else {
			$systemNavigation = array(
				'pages' => array(
					array(
						'label' => Yii::t('crm', 'System Einstellungen'),
						'url' => array('/core/system/settings'),
						'icon' => 'settings',
						'pages' => array(
							array(
								'label' => Yii::t('crm', 'Module Einstellungen'),
								'url' => array('/core/system/moduleSettings'),
								'icon' => 'module-settings',
							),
							array(
								'label' => Yii::t('crm', 'Individual Einstellungen'),
								'url' => array('/core/system/individualSettings'),
								'icon' => 'module-settings',
							),
						),
					),
					array(
						'label' => Yii::t('crm', 'Einstellungen'),
						'url' => array('/core/user/changeMe'),
						'icon' => 'user'
					),
					array(
						'label' => Yii::t('crm', 'Logout'),
						'url' => array('/core/user/logout'),
						'icon' => 'locked'
					),
				),
			);
		}
		$this->render ( 'userMenu', array('systemNavigation' => $systemNavigation) );
	}
}